#例9-19将二维数据写入到CSV格式文件
list =[['水果名称', '单价', '数量', '金额'],
['葡萄', '30', '1.5', '45'],
['香蕉', '10', '3', '30'],
['西瓜', '12', '2', '26']]
f3_name="shuiguoqingdan.csv"
f3=open(f3_name, 'w')
for row in list:
    f3.write(",".join(row)+ "\n")
print("数据写入",f3_name, "成功。")
f3.close()
